package com.vca.front.controller;

import com.vca.common.response.ExhibitionVoResponse;
import com.vca.common.result.CommonResult;
import com.vca.common.vo.ExhibitionVo;
import com.vca.service.service.ExhibitionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.extern.slf4j.Slf4j;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;

/**
 * 展览控制器
 *
 * @author chenbing
 * @date 2022/11/3   17:38
 */
@Slf4j
@RestController("ExhibitionController")
@RequestMapping("api/front/exhibition")
@Api(tags = "展览控制器")
public class ExhibitionController {
    @Autowired
    private ExhibitionService exhibitionService;

    /**
     * @Description:展览详情
     * @Author: chenBing
     * @Date: 2022/11/3
     */
    @ApiOperation(value = "展览详情")
    @GetMapping(value = "/info")
    public CommonResult<ExhibitionVo> info(
            @RequestHeader(value = "language",required = false) String language,
            @RequestParam(value = "exhibitionId") Long exhibitionId
    ) {
        return CommonResult.success(exhibitionService.info(language,exhibitionId));
    }

    /**
     * @Description:展览列表
     * @Author: chenBing
     * @Date: 2022/11/16
     */
    @ApiOperation(value = "展览列表")
    @GetMapping(value = "/list")
    public CommonResult<ExhibitionVoResponse> list(@RequestHeader(value = "language",required = false) String language) {
        return CommonResult.success(exhibitionService.getListNoPage(language));
    }
}
